#ifndef SOCKET_H
#define SOCKET_H

#include <QWidget>
#include <QUdpSocket>
#include <QDebug>

namespace Ui {
class Socket;
}

class Socket : public QWidget
{
    Q_OBJECT

public:
    explicit Socket(QWidget *parent = 0);
    ~Socket();
    void sendMsgToSever(const QString sMsg,const QString sHostAddr,const QString sHostPort);

private:
    Ui::Socket *ui;
    QUdpSocket* udpSocket; //定义一个socket与下位机通信

private slots:
    void readPendingDatagrams();
    void on_pushButton_released();
    void on_pushButton_2_released();
};

#endif // SOCKET_H
